home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13770 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: diable.upc.es!eduarde
  2. From: eduarde@ac.upc.es (Eduard Elias i Vila)
  3. Newsgroups: comp.lang.c++
  4. Subject: more sampling from a sound card in VC++
  5. Date: 27 Mar 1996 10:49:09 GMT
  6. Organization: Departament D'arquitectura de Computador (UPC)
  7. Message-ID: <4jb6f5$f7c@diable.upc.es>
  8. NNTP-Posting-Host: nebot.ac.upc.es
  9. Mime-Version: 1.0
  10. Content-Type: text/plain; charset=iso8895-1
  11. Content-Transfer-Encoding: 7bit
  12. X-Newsreader: TIN [version 1.2 PL2]
  13.  
  14.  
  15.  
  16.    One of my students is trying to built, with me, a program able to determine
  17. the pitch of a note singed in front of a microphone connected to a soundblaster
  18. compatible card.
  19.  
  20.    He is programming in Visual C++, on windows (3.1, not Windows 95). He
  21. doesn't have net access, so I report the following problem:
  22.  
  23.    To read from the sound card, he uses a sentence like this:
  24.  
  25.  
  26.         Error = waveInOpen( ... , Window1, 0, CALLBACK_WINDOW);
  27.                                   ^^^^^^^(the forth parameter)
  28.  
  29.    The problem is with the Window1. It is declared as a HWND. He saw that,
  30. depending on the definition or not of STRICT, this type is a UINT (when
  31. STRICT is not defined) or a pointer to a struct (const struct::HWND__ __near*
  32. when STRICT is defined).
  33.  
  34.    The call waveInOpen needs Window1 to be a UINT but if he undefines the
  35. symbol STRICT, then some other problems appear at link time.
  36.  
  37.    I reported this problem some days ago but, as it is still not solved, I
  38. repost it with more information.  We have tried the following possibilities:
  39.  
  40.  1) STRICT defined
  41.     HWND Window1   as the declaration of Window1
  42.     (UINT) Window1 in the call to waveInOpen
  43.  
  44.     No problem at compilation or linking time.
  45.     At run time, the waveInOpen call, returns an external undefined error.
  46.  
  47.  2) STRICT defined
  48.     HWND Window1   as the declaration of Window1
  49.     (DWORD) Window1 in the call to waveInOpen (some suggested this last time)
  50.  
  51.     At compilation time gives a warning about the type casting.
  52.     At run time it gives the same error than option 1.
  53.  
  54.  3) STRICT undefined at the start and for all the program
  55.     HWND Window1   as the declaration of Window1
  56.     Window1 or (UINT) Window1 in the call to waveInOpen
  57.  
  58.     At linking time gives the error "protected: virtual long (_far __pascal
  59.         *__ near**__far pascal CWND: GetsuperwndProc Addr (void) __near
  60.         (unsigned int, unsigned int, unsigned int, long): unresolved
  61.         external" and similars for a very long list of calls from the
  62.         libraries (like this GetsuperwndProc, for instance).
  63.     (I didn't write carefully the error, so I'm not sure about the quan-
  64.     tities of _ and spaces in it)
  65.  
  66.  4) STRICT undefined only in the portion that includes the declaration of
  67.         Window1 and the call to waveInOpen.
  68.     HWND Window1   as the declaration of Window1
  69.     Window1 or (UINT) Window1 in the call to waveInOpen
  70.  
  71.     The same results than in option 1.
  72.  
  73.  
  74.    I'm just looking for "the right option we still didn't try". Any help will
  75. be very, very, very much appreciated. Thanks in advance.
  76.  
  77.  
  78. --
  79.  
  80.     Eduard Elias i Vila
  81.      eduarde@ac.upc.es
  82.